Problem 2.2
Algorithm to solve a Rubiks Cube
Chose a target edge cubelet, call it X.
Step 1Place The Edge Cubelets in the UP Layer (ignoring
orientation):
- If X
is in the UP Layer.
- If X
is in the proper positions (orientation may be incorrect), chose a
different X.
- Apply
F^2, R^2, B^2, or L^2 such that the move places X in the BOT Layer (this
is the layer underneath the MID Layer).
- Apply
D until X is placed underneath its correct position.
- Apply
F^2, R^2, B^2, or L^2 to move X into its proper location
- If
not all UP edge cubelets are placed, chose another UP edge cubelet, call
it X, and repeat step 1.
- If X
is in the MID Layer (this is the layer underneath the UP Layer)
- Apply
U until an application of L, R, F or B permutes X while keeping the
already placed edge cubelets in the UP layer. Call this process Z.
NOTE: this is possible
since not all of the UP edge cubelets have been placed.
- Apply
L, R, F or B such that it places X in the BOT Layer
- Apply
Z^(-1)
- Apply
D until X is placed underneath its correct position.
- Apply
F^2, R^2, B^2, or L^2 to move X into its proper location
- If
not all UP edge cubelets are placed, chose another UP edge cubelet, call
it X, and repeat step 1.
- If X
is in the BOT Layer (this is the layer underneath the MID Layer)
- Apply
D until X is placed underneath its correct position.
- Apply
F^2, R^2, B^2, or L^2 to move X into its proper location
- If
not all UP edge cubelets are placed, chose another UP edge cubelet, call
it X, and repeat step 1.
Step 2Orient the UP Edge Cubelets
While there is a UP Edge Cubelet with incorrect orientation
- Chose
a UP edge cubelet with incorrect orientation, call it X.
- Reorient
the cube such that X is facing you
- Apply
FR^(-1)D^(-1)RF^(2)
- Continue
if there is a UP Edge Cubelet with incorrect orientation
Step 3Place UP corner cubelets with position and
orientation
Chose a target UP corner cubelet,
call it X.
- If X
is in the UP Layer
- If X
is in the correct position with proper orientation chose another X
- Reorient
the cube such that X is facing you and on the left
- Apply
LDL^(-1)
- X is
now in the BOT Layer
- Apply
D until X is underneath its correct position
- Apply
D^2
- Reorient
the cube such that X is facing you and on the left
- NOTE:
X is in the (f d l) position and its correct position is (b r u); i.e.
they are opposite
- If
the permutation (f d l, b r u)
places X correctly
- Apply
B^(-1)D^2B
- Repeat
step 1 if needed
- If
the permutation (f d l, u b r)
places X correctly
- Apply
RD^2R^(-1)
- Repeat
step 1 if needed
- If
the permutation (f d l, r u b)
places X correctly
- Apply
RD^2R^(-1)
- NOTE:
X is in the correct spot, but wrong orientation
- Apply
[B^(-1)D^2B][RD^2R^(-1)]
- Repeat
Step 3 while more UP edge cubelets must be placed.
Step 4Place MID Layer Edge Cubelets (ignoring orientation)
Chose a target edge cubelet, call it X
While there is a misplaced MID edge cubelet
- If X
is not in the BOT Layer
·
If X is in the MID Layer and correct position chose
another X
·
If X is in the MID Layer, but in the incorrect
positions
o
Reorient the cube such that X is in the (f r) position
o
Apply L^(-1)D^(-1)(F^2D^2)^3DL
o
NOTE: Now X is in the BOT Layer
Now X is in the BOT Layer
- Reorient
the cube such that Xs correct position is in the (f r) position
- Apply
D until X is in the (d l) position
- Apply
L^(-1)D^(-1)(F^2D^2)^3DL
- X is
now in the correct position, repeat if needed; otherwise go to Step 5
Step 5Orient MID Layer Edge Cubelets
Chose a MID layer edge cubelet with incorrect orientation
and call it X
While there are incorrectly oriented MID edge cubelets
- Orient
the cube such that X is in the (f r) position
- Apply
L^(-1)D^(-1)(F^2D^2)^3DL
- Apply
D^2
- Apply
FD^(-1)F^(-1)D^(-1)FD^2F^(-1)DFDF^(-1)D^2
- Repeat
if needed; otherwise go to Step 6
Step 6Place BOT Layer Corner Cubelets (ignoring
orientation)
Apply B until at least one BOT corner cubelet is in its
correct position
While all the corner cubelets are not in their correct
positions
- If
there are three corner cubelets not positioned correctly
- NOTE:
There is a pair of corner cubelets (that are in the same face) such
that swapping those edge cubelets will correctly place one of them.
- Reorient
the cube such that those corner cubelets are in the front face
- Apply
R^(-1)D^(-1)RFDF^(-1)R^(-1)DRD^2
- NOTE:
Now there are only two misplaced corner cubelets
- Repeat
Step 6
- If
there are two corner cubelets not positioned
- Chose
a corner cubelet that has not been placed, call it X
- Reorient
the cube such that X is in the (f d l) position
- If
the other unplaced corner cubelet is in the (r b d) position
- Reorient
the cube such that X is in the (b l d) position
- Apply
R^(-1)D^(-1)RFDF^(-1)R^(-1)DRD^2
- Reorient
the cube such that X is in the (f d l) position
- Apply
R^(-1)D^(-1)RFDF^(-1)R^(-1)DRD^2
- NOTE:
Now there are two unplaced corner cubelets that are in the same face.
- Reorient
the cube such that those corner cubelets are in the front face
- Apply
R^(-1)D^(-1)RFDF^(-1)R^(-1)DRD^2
- Continue
to step 7
- Otherwise
the two unplaced corner cubelets are in the same face
- Reorient
the cube where that face is the front face
- Apply
R^(-1)D^(-1)RFDF^(-1)R^(-1)DRD^2
- Continue
to step 7
Step 7Orient the bottom corner cubelets
NOTE: R^(-1)D^(-1)RD^(-1)R^(-1)D^2RD^2 fixes all
corner cubelets and all UP edge cubelets while changing the orientation of the
(f r d) , ( r b d) and (l b d) corner cubelets
- If
none of the BOT corner cubelets have correct orientation
- Apply
R^(-1)D^(-1)RD^(-1)R^(-1)D^2RD^2 until at least one cubelet has proper orientation.
- Reorient
the cube such that the properly oriented corner cubelet is in the
(f l d) position.
- Continue
applying R^(-1)D^(-1)RD^(-1)R^(-1)D^2RD^2 until all BOT corner cubelets have
correct orientation.
- Otherwise
reorient the cube such that one of the properly oriented BOT corner
cubelets in the (f l d) position and apply
R^(-1)D^(-1)RD^(-1)R^(-1)D^2RD^2 until all BOT corner cubelets have correct orientation.
Step 8Place BOT Layer Edge Cubelets (with correct
orientation)
Let Z = L^(-1)RF^(-1)LR^(-1)D^2L^(-1)RF^(-1)LR^(-1)
Y =
FLB^(-1)L^(-1)BF^(-1)DBD^(-1)B^(-1)
NOTE: Z = (r d , l d , d b)
Y= (r
d , b d , d l)
While the cube is not solved
- Choose
a misplaced BOT Edge Cubelet
- Reorient
the cube if necessary and apply Z or Y such that X is placed correctly
with correct orientation
NOTE: Do not simply place X choose Z or Y such that
it places X with correct orientation.
End Algorithm